package com.zbkj.crmeb.enums.logistics;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 物流快递签收状态
 *
 * @author lmd
 * @Description:
 * @date 2021-12-31
 */
public enum DeliverySignStatusEnum implements IEnum<Integer> {
    /**
     * 未签收
     */
    UN_SIGN(0, "未签收"),

    /**
     * 已签收
     */
    SIGN(1, "已签收"),

    ;

    private final Integer code;
    private final String msg;

    DeliverySignStatusEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    @JsonCreator
    public static DeliverySignStatusEnum valueOf(Integer code) {
        for (DeliverySignStatusEnum value : values()) {
            if (code.equals(value.getCode())) {
                return value;
            }
        }
        return DeliverySignStatusEnum.UN_SIGN;
    }

    @Override
    @JsonValue
    public Integer getValue() {
        return code;
    }

}

